#!/usr/bin/python3

import subprocess as sub


def ram():
    p = sub.Popen(['free'], stdout=sub.PIPE)
    stdout = p.stdout.read().decode()
    total, used, free = stdout.splitlines()[1].split()[1:4]
    return 'total: %s\nused: %s\nfree: %s\n' % (total, used, free)


if __name__ == '__main__':
    text = ram()
    print('Content-Type: text/plain\n\n', end='')
    print(text)
